/*
 * DiscoveryActivityPushProcess.java
 * business
 *
 * Created by chentao on 2017/4/26.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.push.process;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import com.yidiandao.business.constant.Intents;
import com.yidiandao.business.data.bean.Message;
import com.yidiandao.business.data.push.AbsPushProcess;
import com.yidiandao.business.ui.url.UrlActivity;

/**
 * 发现页-活动文章推送
 * <p>
 * Created by ChenTao(chentao7v@gmail.com) on 2017/4/26 0026 13:58
 */
public class ArticlePushProcess extends AbsPushProcess {

    public ArticlePushProcess(Context context, Message message, boolean isForeground) {
        super(context, message, isForeground);
    }

    @Override
    public Intent getClickNotificationJumpActivityIntent() {
        // 点击跳转到文章页面
        return new Intent(mContext, UrlActivity.class);
    }

    @Override
    public void onDialogEnsureButtonClick(Message message) {
        UrlActivity.actionStartForArticle((Activity) mContext, message.getArticleId());
    }

    @Override
    protected void addExtraDataToNotificationClickReceiverIntent(Intent intent) {
        // 跳转到文章页面
        intent.putExtra(Intents.EXTRA_ARTICLE, true);
        intent.putExtra(Intents.EXTRA_ARTICLE_ID, mMessage.getArticleId());
    }
}
